home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.2 KB | 81 lines | [TEXT/GEOL] |
- Item 9954747 7-Aug-90 17:34PDT
-
- From: AFTERHOURS After Hours SW,Richard Wolpert,PRT
-
- To: PHAROS.TECH Pharos Tech, Tech Staff,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: RE> Dashed Lines
-
-
- TO: PHAROS.TECH,MACAPP.TECH$
- FR: AFTERHOURS
- RE: Dashed Lines in Postscript
-
- Look at tech. Notes #72 and #91. Each discusses LaserWriter specific
- information. #91 discusses PicComments, one of which draws Dashed lines. In
- MacApp, create a subclass of TView, something like TDashedLine, or embed the
- code in any other TView object in the .Draw method. Quoting liberally from
- tech. Note #91, an view object class with dashed lines might look like this:
-
-
- TDashedLine = OBJECT(TView)
-
- PROCEDURE TDashedLine.Draw(area: Rect); OVERRIDE;
-
- END;
-
-
- PROCEDURE TDashedLine.Draw(area: Rect);
- CONST
- DashedLine = 180;
- DashedStop = 181;
- SetLineWidth = 182;
- TYPE
- DashedHdl = ^DashedPtr;
- DashedPtr = ^TDashedLine;
- TDashedLine = RECORD
- offset : SignedByte;
- Centered: SignedByte;
- Dashed : Array[0..1] OF SignedByte;
- END;
-
- widHdl = ^widPtr;
- widPtr = &widpt;
- widpt = Point;
- VAR
- aRect : Rect;
- width : WidHdl;
- dashedln : DashedHdl;
- BEGIN
- dashedln := dashedHdl(NewHandle(SIZEOF(TDashedLine)));
- dashedln^^.offset := 0;
- dashedln^^.centered := 0;
- dashedln^^.dashed[0] := 1; { length }
- dashedln^^.dashed[1] := 8; { 8 points on, 8 points off }
-
- width := widhdl(NewHandle(SIZEOF(widpt)));
- width^^.h := 2;
- width^^.v := 7;
-
- PicComment(DashedLine, GetHandleSize(dashedln), Handle(dashedln));
- PicComment(SetLineWidth, 4, Handle(width));
-
- { draw your line, shape, etc here }
- MoveTo(100, 100);
- LineTo(500, 500);
-
- PicComment(DashedStop, 0, NIL);
-
- INHERITED Draw(area);
- END;
-
-
- I've done a similar thing with embedded spostscript code for other purposes, so
- something like this should work. Good luck...
-
- Dan Cooley
- After Hours Software
-
-